package com.mayikt.service;

import com.mayikt.entity.MayiktUserEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: BuMingBo
 * @ClassName: MyIndexService
 * @create: 2022-05-20 05:34
 * Version: 1.0
 */
@RestController
@Slf4j
public class MyIndexService {

    @Value("${mayikt.name}")
    private String name;

    @Value("${mayikt.age}")
    private String age;

    @Value("${mayikt.addres}")
    private String addres;

    @Autowired
    private MayiktUserEntity mayiktUserEntity;

    @RequestMapping("/getNameAndAge")
    public String getNameAndAge(){
        return name + "," + age;
    }

    @RequestMapping("/getName")
    public String getName(String name, int age) {
        log.info("name:{},age:{}", name, age);
        log.debug("");
        try {

        }catch (Exception e){
            log.error("");
        }
        return name;
    }

    @RequestMapping("/getNameAndAgeAddres")
    public String getNameAndAgeAddres(){
        return mayiktUserEntity.toString();
    }

}

